//
//  NSDate+helper.m
//  RecordApp
//
//  Created by chaichai on 2022/3/2.
//

#import "NSDate+helper.h"

@implementation NSDate (helper)
-(NSInteger)day
{
    NSInteger d = [self timeIntervalSince1970] / (24*3600);
    return d;
}
-(NSString *)YMDString
{
    NSDateFormatter *dateStringFormatter = [[NSDateFormatter alloc] init];
    [dateStringFormatter setDateFormat:@"yyyy-MM-dd"];
    return [dateStringFormatter stringFromDate:self];
}
-(NSDate *)addDays:(NSInteger)days
{
    return [self dateByAddingTimeInterval:days * (24 * 3600)];
}
@end
